// invokeOtherFunc.js
var http = require('http');

var other = require('./module/otherfunc.js');
var other02 = require('./module/otherfunc002.js');

function func01(){
    console.log(1, 'hello, I\'m function 01');
}

function func02(){
    console.log(2, 'hello, I\'m function 02');
}


var server = http.createServer(function(req, resp){
    if(req.url != '/favicon.ico'){
        func01();
        other();
        resp.end('hello,world');
        func02(); // func02() 仍然会执行！
        // 在`resp.end()`之后加上`resp.write()`会报错; Error: write after end
        // resp.write('你好！'); 
        other02.a();
        other02.b();
        other02.c();
    }
});

server.listen(3000, '127.0.0.1');